package com.cyys.modules.system.tag;

import java.io.IOException;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.SimpleTagSupport;

import com.cyys.modules.core.shiro.token.manage.TokenManager;
import com.cyys.modules.system.model.user.User;

public class HeaderMenuTag extends SimpleTagSupport{
	
	

	@Override
    public void doTag() throws JspException, IOException {
		User user = TokenManager.getToken();
		//String headsrc = "http://t.cn/RCzsdCq";
		
		//String contextPath = ((HttpServletRequest) ((PageContext)this.getJspContext()).getRequest()).getContextPath();
		
		StringBuffer buffer = new StringBuffer();
		buffer.append("<ul class='layui-nav layui-layout-right' lay-filter='layadmin-layout-right'>");
		
		buffer.append("<li class='layui-nav-item layui-hide-xs' lay-unselect>");
		buffer.append("<i class='layui-icon layui-icon-theme'></i>");
		buffer.append("</a></li>");
		
		
		buffer.append("<li class='layui-nav-item' lay-unselect>");
		buffer.append("<a href='javascript:;'><cite>" + user.getUsername() + "</cite></a>");
		buffer.append("<dl class='layui-nav-child'>");
		buffer.append("<dd><a lay-href=''>修改密码</a></dd>");
		buffer.append("<hr>");
		buffer.append("<dd onclick='logout()' style='text-align: center;'><a>退出</a></dd>");
		buffer.append("</dl></li>");
		buffer.append("</div>");
	    
        getJspContext().getOut().write(buffer.toString());
    }  
}
